<template>
  <y-base-page title="我的反馈">
    <view class="y-scroll-container">
      <view class="y-card"  v-for="index in feedbacklist" :key="index">
        <view class="item y-margin-bottom ">
          <view class="y-flex-between y-box">
            <span class="y-title">{{index.feedbackType==0?'与费用相关':index.feedbackType==1?'与服务相关':index.feedbackType==2?'为与护理员相关':'为其他类型'}}</span>
            <span class="y-color-primary">{{index.status==0?'新回复':'已回复'}}</span>
          </view>
          <view class="y-bg-grey y-margin-top-md y-border-radius y-padding" @click="switchB(index.id)">
            <view class="y-textzi" >
              {{index.feedbackContent}}
            </view>
          <view class="y-time">
           {{index.feedbackTime}}
          </view>
          </view>
        </view>
      </view>
    </view>
  </y-base-page>
</template>

<script>
import {userFeedback} from '@/api/ctmkt'
export default {
  data() {
    return {
      feedbacklist:[], //我的反馈list
      id:'',
    };
  },
  created () {
    this.Feedback()
  },
  methods: {
    async Feedback(){
      const res = await userFeedback()
      this.feedbacklist = res.data.data
      console.log(res);
    },
    switchB(id) { 
      // console.log('id',id);
          uni.navigateTo({
			    url: `/pages/common/feedback/my/detail?id=${id}`
			});
    }
  }
};
</script>

<style lang="scss" scoped>
 .y-card{
   .y-margin-bottom{
     .y-box{
       padding-bottom: 12px;
       border-bottom: 1px solid #D2D2D2;
     }
     .y-padding{
       position: relative;
       margin-top: 12px;
       height: 82px;
       
       .y-textzi{
       width: 247px;
       margin-bottom: 12px;
       overflow : hidden;
       text-overflow: ellipsis;
       display: -webkit-box;
       -webkit-line-clamp: 2;
       -webkit-box-orient: vertical;
       }
       .y-time{
         position: absolute;
         bottom: 15px;
       }
     }
   }
 }
</style>
